        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Manifold class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="Manifold">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/Manifold.html">Manifold</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Manifold</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class Manifold {
 /** The points of contact. */
 final List&lt;ManifoldPoint&gt; points;

 /**
  * The meaning of the localNormal depends on the type of this manifold. The
  * different meanings (or lack thereof) are outlined below.
  * Circles: not used.
  * faceA: The normal on polygonA.
  * faceB: The normal on polygonB.
  */
 final vec2 localNormal;

 /**
  * The meaning of the localPoint depends on the type of this manifold. The
  * different meanings (or lack thereof) are outlined below.
  * Circles: The local center of circleA.
  * faceA: The center of faceA.
  * faceB: The center of faceB.
  */
 final vec2 localPoint;

 /** The type of manifold. See [ManifoldType]. */
 int type;

 /** The number of manifold points. */
 int pointCount;

 /**
  * Creates a manifold with 0 points. It's point array should be full of
  * already instantiated ManifoldPoints.
  */
 Manifold() :
     points = new List&lt;ManifoldPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
     localNormal = new vec2.zero(),
     localPoint = new vec2.zero(),
     pointCount = 0 {
   for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; ++i)
     points[i] = new ManifoldPoint();
 }

 /**
  * Creates a new manifold that is a copy of the given manifold.
  */
 Manifold.copy(Manifold other) :
     points = new List&lt;ManifoldPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
     localNormal = new vec2.copy(other.localNormal),
     localPoint = new vec2.copy(other.localPoint),
     pointCount = other.pointCount,
     type = other.type {
   for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; ++i)
     points[i] = new ManifoldPoint.copy(other.points[i]);
 }

 /**
  * Sets this manifold to be a copy of the given manifold.
  */
 void setFrom(Manifold other) {
   for (int i = 0; i &lt; other.pointCount; ++i)
     points[i].setFrom(other.points[i]);

   type = other.type;
   localNormal.copyFrom(other.localNormal);
   localPoint.copyFrom(other.localPoint);
   pointCount = other.pointCount;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="Manifold">
<button class="show-code">Code</button>
new <strong>Manifold</strong>() <a class="anchor-link" href="#Manifold"
              title="Permalink to Manifold.Manifold">#</a></h4>
<div class="doc">
<p>Creates a manifold with 0 points. It's point array should be full of
already instantiated ManifoldPoints.</p>
<pre class="source">
Manifold() :
   points = new List&lt;ManifoldPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
   localNormal = new vec2.zero(),
   localPoint = new vec2.zero(),
   pointCount = 0 {
 for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; ++i)
   points[i] = new ManifoldPoint();
}
</pre>
</div>
</div>
<div class="method"><h4 id="Manifold.copy">
<button class="show-code">Code</button>
new <strong>Manifold.copy</strong>(<a href="../box2d/Manifold.html">Manifold</a> other) <a class="anchor-link" href="#Manifold.copy"
              title="Permalink to Manifold.Manifold.copy">#</a></h4>
<div class="doc">
<p>Creates a new manifold that is a copy of the given manifold.</p>
<pre class="source">
Manifold.copy(Manifold other) :
   points = new List&lt;ManifoldPoint&gt;(Settings.MAX_MANIFOLD_POINTS),
   localNormal = new vec2.copy(other.localNormal),
   localPoint = new vec2.copy(other.localPoint),
   pointCount = other.pointCount,
   type = other.type {
 for (int i = 0; i &lt; Settings.MAX_MANIFOLD_POINTS; ++i)
   points[i] = new ManifoldPoint.copy(other.points[i]);
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="localNormal">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localNormal</strong> <a class="anchor-link"
            href="#localNormal"
            title="Permalink to Manifold.localNormal">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localNormal
</pre>
</div>
</div>
<div class="field"><h4 id="localPoint">
<button class="show-code">Code</button>
final <a href="../vector_math/vec2.html">vec2</a>         <strong>localPoint</strong> <a class="anchor-link"
            href="#localPoint"
            title="Permalink to Manifold.localPoint">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localPoint
</pre>
</div>
</div>
<div class="field"><h4 id="pointCount">
<button class="show-code">Code</button>
int         <strong>pointCount</strong> <a class="anchor-link"
            href="#pointCount"
            title="Permalink to Manifold.pointCount">#</a>
        </h4>
        <div class="doc">
<pre class="source">
pointCount
</pre>
</div>
</div>
<div class="field"><h4 id="points">
<button class="show-code">Code</button>
final List&lt;<a href="../box2d/ManifoldPoint.html">ManifoldPoint</a>&gt;         <strong>points</strong> <a class="anchor-link"
            href="#points"
            title="Permalink to Manifold.points">#</a>
        </h4>
        <div class="doc">
<pre class="source">
points
</pre>
</div>
</div>
<div class="field"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to Manifold.type">#</a>
        </h4>
        <div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="setFrom">
<button class="show-code">Code</button>
void <strong>setFrom</strong>(<a href="../box2d/Manifold.html">Manifold</a> other) <a class="anchor-link" href="#setFrom"
              title="Permalink to Manifold.setFrom">#</a></h4>
<div class="doc">
<p>Sets this manifold to be a copy of the given manifold.</p>
<pre class="source">
void setFrom(Manifold other) {
 for (int i = 0; i &lt; other.pointCount; ++i)
   points[i].setFrom(other.points[i]);

 type = other.type;
 localNormal.copyFrom(other.localNormal);
 localPoint.copyFrom(other.localPoint);
 pointCount = other.pointCount;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
